/**
 * 
 */
package vn.lumi.smarthome.service;

import android.content.Context;
import android.os.Vibrator;

/**
 * @author HuyHieu
 *
 */
public class VibrateThread extends Thread {
	
	Context mContext;
	private int miliseconds;
	public VibrateThread(Context mContext){
		this(mContext, 30);
	}
	public VibrateThread(Context mContext, int miliseconds){
		this.mContext = mContext;
		this.miliseconds = miliseconds;
	}

	@Override
	public void run() {
		// TODO Auto-generated method stub
		super.run();
		Vibrator v = (Vibrator) mContext.getSystemService(
				Context.VIBRATOR_SERVICE);
		if (v.hasVibrator()) {
			v.vibrate(this.miliseconds);
		}
	}

}